<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jQuery</title>
    <script src="lib/jquery-3.6.0.js"></script>
</head>

<body>
    <div><input type="checkbox" id="agree" checked>同意并接受注册协议</div>
    <button>提交</button>
</body>
<script>
    let $btn = $('button')[0];
    $agree = $("input[type='checkbox']");
    $btn.onclick = function () {
            if ($agree.is(':checked')==true) {
                alert("提交成功");
            } else {
                alert("不同意协议，我们将无法为您提供服务");
            }
        }

</script>

</html>